package com.up.interview.flowable.repository;

/**
 * @author: liuchengjun
 * @title: LeaveRequestRepository
 * @projectName: 海联技术中台V2.0
 * @depart 软件事业部
 * @description:
 * @date: 2025/10/30/周四 16:05 (星期四)
 * @since V2.0
 */

import com.up.interview.flowable.entity.LeaveRequest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * 请假申请 Repository
 */
@Repository
public interface LeaveRequestRepository extends JpaRepository<LeaveRequest, Long> {

    /**
     * 根据流程实例ID查询
     */
    Optional<LeaveRequest> findByProcessInstanceId(String processInstanceId);

    /**
     * 根据申请人查询
     */
    List<LeaveRequest> findByEmployee(String employee);

    /**
     * 根据状态查询
     */
    List<LeaveRequest> findByStatus(String status);
}
